<?include("../../config/config.php");
$DM->loadClass("tracker","site");
// create and instance class
if(!$_GET['idc']){
	exit('INVALID COMPANY');
}
$object_site = new site($_GET['idc']);
$object_site->getList();
?>
<html>
<head>
<title>site</title>
<link href="../../resource/includes/css/admin.css" type="text/css" rel="stylesheet" rev="stylesheet" />
<script>
function apagar(_id){
	if (confirm('Erase this item from the system?')){
		window.location.href='site.delete.php?id='+_id+'&apagar=apag';
	}
}
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">
<table border="0" cellpadding="4" cellspacing="1" bgcolor="#efefef"  width='600'>
	<tr align=left>
		<td height='25' colspan='6' class='titleTd'>LISTA DE SITE</td>
	</tr>		
	<tr align='center'>
		<td height='25' colspan='6' align='center'><a href="site.edit.php?idc=<?=$_GET['idc']?>" class='mainAction'>ADICIONAR NOVA site</a></td>
	</tr>		
	<tr align='center'>
		<td height='25' colspan='6' bgcolor="#FFFFFF"></td>
	</tr>		
	<tr>		<td class='titleTd' align='center'>ID</td>
		<td class='titleTd' align='center'>Company</td>
		<td class='titleTd' align='center'>Name</td>
		<td class='titleTd' align='center'>URL</td>
		<td class='titleTd' align='center'>active</td>
		<td class='titleTd' align='center'>Actions</td>
	</tr>
<?
for ($i=0;$i<count($object_site->lista);$i++){
$line = $line!="line1"?"line1":"line2";
	$object_site->id_site=$object_site->lista[$i][id_site];
	$object_site->getById();
	echo "<TR>
<td align='center' class='<?=$line?>'>$object_site->id_site</td>
<td align='center' class='<?=$line?>'>$object_site->id_company</td>
<td align='center' class='<?=$line?>'>$object_site->txt_name</td>
<td align='center' class='<?=$line?>'>$object_site->txt_url</td>
<td align='center' class='<?=$line?>'>$object_site->bol_active</td>
		<td align='center'><a class='minorAction' href='site.edit.php?id=$object_site->id_site'>editar</a> - <a class='minorAction' href='javascript:apagar($object_site->id_site);'>apagar</a></td>
	";
	echo "</TR>";
}
?>
</table></body></html>